Câu ví dụ
- So if you get type errors like this one when using Either as a monad, just add an explicit type signature:
Như vậy nếu bạn nhận được các lỗi kiểu, như lỗi này khi dùng Either làm monad, thì chỉ cần thêm hẳn một dấu ấn kiểu: - The type signature says that it takes a function that takes an a and returns a b, a list of a's and returns a list of b's.
Dấu ấn kiểu nói rằng nó nhận vào một hàm, hàm này nhận một a và trả lại một b, cùng một danh sách các a, rồi trả lại một danh sách các b. - when a method in a subclass has the same name and type signature as a method in its superclass, then the method in the subclass is said to override the method in the superclass.
Khi một method của subclass có cùng tên, kiểu dữ liệu trả về và các tham số với một method của superclass, thì method trong subclass sẽ override method trong superclass.